Enviado por: phpmysql
Fecha: 2003-06-05 10:15:37
Actualizado: 2004-01-03 09:00:52
¿Usa base de datos?: 0
Visitas: 1378
Votos: 0
Descargado: 704 veces
Valoración: 0.00
» Valora este script «
ZipDescargar

El sistema sirve para tener una serie de enlaces y tiene la posibilidad de agregar enlaces desde internet. consta de los siguentes archivos: [b]descargas.php[/b] para ver las descargas [codigo] <html> <head> <title>Descargas</title> </head> <div align="center"> <body> <table width="50%" border="1" cellspacing="0"> <tr> <td height="68"><div align="center"><br> <a href="descargas.php"><img src="down-logo.gif" alt="" width="221" height="42" border="0"></a><br> <br> <font class="content">[ <a href="descargas.php">Indice</a> | <a href="subir.php">A�adir Descarga</a> ]<br> <br> </font></div></td> </tr> </table> <br> <table width="50%" border="1" cellspacing="0"> <tr> <td><div align="center"> <?php include("descargas.txt"); #aqu� para cambiar la ruta del archivo que muestra las entradas ?> </div></td> </tr> </table> <br> <br> </div> </body> </html> [/codigo] [b]subir.php[/b] el formulario para enviar descargas. [codigo] <html> <head> <title>Untitled Document</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head> <body> <div align="center"> <table width="50%" border="1" cellspacing="0"> <tr> <td height="68"><div align="center"><br> <a href="descargas.php"><img src="down-logo.gif" alt="" width="221" height="42" border="0"></a><br> <br> <font class="content">[ <a href="descargas.php">Indice</a> | <a href="subir.php">A�adir Descarga</a> ]<br> <br> </font></div></td> </tr> </table> <br> <table width="50%" border="1" cellspacing="0"> <tr> <td><div align="center"> <?php print "<table width='75%' border='0' cellspacing='0'> <form method='post' action='enviar.php' onsubmit='return error ()' name='myform' > <tr> <td width='16%'>Titulo</td> <td width='84%'><input name=titulo type=text id='titulo' maxlenght=30> </td> </tr> <tr> <td height='23'>url del archivo</td> <td>http:// <input name=url type=text id=url2 maxlenght=30></td> </tr> <tr> <td height='23'>Descripcion</td> <td><textarea name='descripcion' id='descripcion2'></textarea></td> </tr> <tr> <td height='23'>Version</td> <td><input name=version type=text id='version2'> </td> </tr> <tr> <td height='23'>Tamaño</td> <td><input name=tama�o type=text id='tama�o'> kb </td> </tr> <tr> <td height='23'>Tu email</td> <td><input name=email type=text></td> </tr> <tr> <td height='23'>Tu web</td> <td>Http:// <input name=weburl type=text></td> </tr> <tr> <td height='23'><input name='submit' type=submit value=Enviar></td> <td></td> </tr> <script> function error (){ if (document.myform.titulo.value == '') { alert('Por favor, introduzca el titulo..'); document.myform.titulo.focus(); return false} if (document.myform.url.value == '') { alert('Por favor, introduzca la url.'); document.myform.url.focus(); return false} if (document.myform.descripcion.value == '') { alert('Por favor, introduzca la descripcion.'); document.myform.descripcion.focus(); return false} else return getPermission(); } </script> </form> </table><br>"; ?> </div></td> </tr> </table> <br> <br> </div> </body> </html> [/codigo] [b]enviar.php[/b] para procesar el envio de las descargas. [codigo] <html> <head> <title>Untitled Document</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head> <body> <div align="center"> <table width="50%" border="1" cellspacing="0"> <tr> <td height="68"><div align="center"><br> <a href="descargas.php"><img src="down-logo.gif" alt="" width="221" height="42" border="0"></a><br> <br> <font class="content">[ <a href="descargas.php">Indice</a> | <a href="subir.php">A�adir Descarga</a> ]<br> <br> </font></div></td> </tr> </table> <br> <table width="50%" border="1" cellspacing="0"> <tr> <td><div align="center"> <?php $pvm = getdate(); $archivo="descargas.txt"; #aqu� para cambiar la ruta del archivo donde se guardan las entradas $uusi="<table width=75% border=0 cellspacing=0 > <tr> <td width=2% height='10'><font class=content ><img src=lwin.gif alt=Editar width=9 height=9 border=0></font></td> <td width=98% ><a href='http://$url'>$titulo</a></td> </tr> <tr> <td height=11 colspan=2><b>Descripci�n:</b> $descripcion</td> </tr> <tr> <td height=23 colspan=2><b>Versi�n: </b>$version <b>Tama�o del archivo: </b>$tama�o<b> </b>Kb</td> </tr> <tr> <td height=23 colspan=2><b>Agregado el: </b>$pvm[mday]-$pvm[mon]-$pvm[year]</td> </tr> <tr> <td height=23 colspan=2><a href=http://$weburl target=new>P�gina de Inicio</a> | <a href=mailto:$email?subject=hay_un_enlace_roto >Informar de un enlace roto</a></td> </tr> </table><br>nn"; $fp=fopen($archivo, "r+"); $vanha=fread($fp, filesize($archivo)); fseek($fp, 0); fwrite($fp, "${uusi}${vanha}"); fclose($fp); print "Descarga añadida <a href=descargas.php>regresar</a>"; ?> </div></td> </tr> </table> </div> <div align="center"></div> </body> </html> [/codigo] [b]descargas.txt[/b] donde se almacenan las descargas, este archivo podemos modificarlo a nuestro gusto ya que sera el que aparecera por defecto en descargas.php . [codigo] <table width=75% border=0 cellspacing=0 > <tr> <td width=2% height='10'><font class=content ><img src=lwin.gif alt=Editar width=9 height=9 border=0></font></td> <td width=98% ><a href='http://download.winzip.com/winzip81.exe'>winzip</a></td> </tr> <tr> <td height=11 colspan=2><b>Descripci�n:</b> Excelente programa para comprimir y descomprimir archivos.</td> </tr> <tr> <td height=23 colspan=2><b>Versi�n: </b>8.1 <b>Tama�o del archivo: </b>10.8<b> </b>Kb</td> </tr> <tr> <td height=23 colspan=2><b>Agregado el: </b>31-5-2003</td> </tr> <tr> <td height=23 colspan=2><a href=http://phpmysql.webcindario.com target=new>P�gina de Inicio</a> | <a href=mailto:[email protected] >Informar de un enlace roto</a></td> </tr> </table> [/codigo] Por ultimo necesitamos esta dos imagenes, guardarlas junto al archivo (guardar destino como) . [b]down-logo.gif[/b] [img]http://elcidop.webcindario.com/modules/Downloads/images/down-logo.gif[/img] [b]lwin.gif[/b] [img]http://elcidop.webcindario.com/modules/Downloads/images/lwin.gif[/img] y con todo esto ya tendremos en nuesto site algo parecido a las descargas del phpnuke, con aviso de enlace roto con posibilidad de agregar descargas y ver en que fecha se han relizado, sitema descargas_sin_mysql by [url] http://www.phpmysql.tk[/url]